package com.jeeplus.modules.statistics.model.enumeration;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 统计维度枚举
 *
 * @author hanKongBin
 * @version 1.0
 * @date 2021/2/27 14:23
 */
@Getter
@AllArgsConstructor
public enum StatisticsDimensionEnum {

    HANDLING(1, "接件量统计"),
    HOT_BUSINESS(2, "热度业务统计"),
    BUSINESS_TRENDS(3, "业务趋势统计");

    private final Integer key;

    private final String value;

    /**
     * 通过key取枚举
     *
     * @param key
     * @return
     */
    public static StatisticsDimensionEnum getTypeByKey(Integer key) {
        if (null == key) {
            return null;
        }
        for (StatisticsDimensionEnum enums : StatisticsDimensionEnum.values()) {
            if (enums.getKey() == key) {
                return enums;
            }
        }
        return null;
    }
}
